from . import views, MixinViews
from rest_framework.routers import DefaultRouter

# 路由列表
from django.urls import path, include, re_path
from rest_framework import routers
router = routers.DefaultRouter()
router.register('bookviewset', views.BookViewSet, basename='bookviewset')

urlpatterns = [
    path('books/', views.BookView.as_view()),
    re_path('books/(?P<pk>\d+)/', views.BookDetailView.as_view()),
    path('booksmix/', MixinViews.BookView.as_view()),
    re_path('booksmix/(?P<pk>\d+)/', MixinViews.BookDetailView.as_view()),
    path('booksson/', views.BookViewSon.as_view()),
    re_path('booksson/(?P<pk>\d+)/', views.BookDetailViewSon.as_view()),
]

urlpatterns += router.urls